#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<unordered_map>
using namespace std;

long long inf = (long long)1e12;

struct node
{
    int next, f;
    long long v;
    node(int a, long long b, int c) : next(a), v(b), f(c) {}
};

struct cmp
{
    bool operator()(node a, node b) const
    {
        return a.v > b.v;
    }
};

void solve()
{
    unordered_map<int, int> flag;
    unordered_map<int, vector<pair<int, int>>> ma;
    priority_queue<node, vector<node>, cmp> que;
    bool s1[200005][2] = { 0 }, s2[200005][2] = { 0 };
    int n, m, k; cin >> n >> m >> k;
    vector<vector<long long>> dis1(n + 5, vector<long long>(2, inf));
    vector<vector<long long>> dis2(n + 5, vector<long long>(2, inf));
    for (int i = 0; i < k; i++)
    {
        int temp; cin >> temp;
        flag[temp] = 1;
    }
    for (int i = 0; i < m; i++)
    {
        int a, b, c; cin >> a >> b >> c;
        ma[a].push_back(pair<int, int>(b, c));
        ma[b].push_back(pair<int, int>(a, c));
    }
    que.push(node(1, 0, 0));
    while (!que.empty())
    {
        node temp = que.top();
        que.pop();
        if (s1[temp.next][temp.f]) continue;
        dis1[temp.next][temp.f] = temp.v;
        s1[temp.next][temp.f] = 1;
        if (temp.f || flag[temp.next])
        {
            for (auto& x : ma[temp.next]) que.push(node(x.first, x.second / 2 + temp.v, 1));
        }
        else
        {
            for (auto& x : ma[temp.next]) que.push(node(x.first, x.second + temp.v, 0));
        }
    }
    que.push(node(n, 0, 0));
    while (!que.empty())
    {
        node temp = que.top();
        que.pop();
        if (s2[temp.next][temp.f]) continue;
        dis2[temp.next][temp.f] = temp.v;
        s2[temp.next][temp.f] = 1;
        if (temp.f || flag[temp.next])
        {
            for (auto& x : ma[temp.next]) que.push(node(x.first, x.second / 2 + temp.v, 1));
        }
        else
        {
            for (auto& x : ma[temp.next]) que.push(node(x.first, x.second + temp.v, 0));
        }
    }
    long long ans = inf;
    for (int i = 1; i <= n; i++)
    {
        long long temp = max(min(dis1[i][1], dis1[i][0]), min(dis2[i][1], dis2[i][0]));
        ans = min(ans, temp);
    }
    if (ans >= inf) cout << -1 << endl;
    else cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}